<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<link href="/styles/general.css" rel="stylesheet" type="text/css" />
<link href="/styles/main.css" rel="stylesheet" type="text/css" />
<script src="/js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="/js/jquery.jeditable.mini.js" type="text/javascript"></script> 
<script src="/js/jquery.confirm.js" type="text/javascript"></script> 
<script type="text/javascript" language="javascript">
$(document).ready(function() {
});
</script>
</head>

<body>
<h1>
<span class="action-span"><a href="/status/add/">添加状态</a></span>
<span class="action-span1"><a href="/index/main/">管理中心</a> </span><span id="search_id" class="action-span1"> - 管理状态 </span>
<div style="clear:both"></div>
</h1>
<form method="post" action="" name="listForm">
<div id='divtablelist'>

<div class="list-div" id="listDiv">
<table width="100%" cellpadding="3" cellspacing="1" id="table_list">
  <tr>
    <th>名称</th>
    <th>值</th>
    <th>描述</th>
    <th>类型</th>
    <th>数据量</th>
    <th>管理操作</th>
  </tr>
{loop $result $k $v}
  <tr>
    <!--{if ($v['issystem']==0) }--><td class="first-cell" align="center"><span class="editname" id="n$v['status']">$v['name']</span><!--{else}--><td align="center">$v['name']<!--{/if}--></td>
    <td align="center">$v['status']</td>
    <!--{if ($v['issystem']==0) }--><td class="first-cell"><span class="editdescription" id="m$v['status']">$v['description']</span><!--{else}--><td>$v['description']<!--{/if}--></td>
    <td align="center"><!--{if ($v['issystem']==1) }-->系统<!--{else}-->自定义<!--{/if}--></td>
    <td align="center">0</td>
    <td align="center">
      <!--{if ($v['issystem']==0) }--><a href='/status/edit/status/$v['status']/'><img src="/images/manage/edit.gif" alt="修改" title="修改"/></a><!--{else}--><img class="grey" src="/images/manage/edit.gif" alt="修改" title="修改"/><!--{/if}--> |
      <!--{if ($v['issystem']==0) }--><a class="confirm" id="d$v['status']" href="void(0);"><img src="/images/manage/del.gif" alt="删除" title="删除"/></a><!--{else}--><img class="grey" src="/images/manage/del.gif" alt="删除" title="删除"/><!--{/if}-->
    </td>
  </tr>
{/loop}
  </table>
</div>

</div>
<input type="hidden" value="/status/index/" name="forward">
</form>
{template 'footer.html'}
</body>
</html>

<script type="text/javascript" language="javascript"> 
	$('.editname').editable('/status/saveajax/type/name/', {
		indicator : '保存...', tooltip   : '点击修改...', onblur    : 'submit' 
	});
    $('.editdescription').editable('/status/saveajax/type/description/', {
        indicator : '保存...', tooltip   : '点击修改...', onblur    : 'submit' 
    });
    $('.confirm').click(function() {
        function deltr(result){
            if ('fail'==result) 
            {
                alert('删除失败！');
                return false;
            }
            if (result!='')
            {
                $('#'+result).parent().parent().remove();
            }
        }
        var del_id = $(this).attr('id');
        del_id = del_id.substr(1);
    	$.ajax({
            url: "/status/delajax/status/"+del_id+"/",
            cache: false, success: deltr
        });
	    return false;
	});
	$('.confirm').confirm({
		msg:'你确认吗？', timeout:3000, buttons: { ok:'确定', cancel:'取消' }
	});
</script>